<?php

namespace app\common\model;

use think\facade\Db;


class SystemCityModel extends CommonModel{

    protected  $name = 'system_city';

    protected  $pk   = 'id';

    public static function list($where,$order,$page=1,$limit=10){
        $query = Db::name('system_city')->alias('a')
            ->where(['a.initials'=>''])
            ->when(!empty($where['shop_id']),function ($query) use ($where){
                $query->where(['a.shop_id'=>$where['shop_id']]);
            })
            ->field("a.*");
        $list=$query->order($order)
            ->limit($limit)->page($page)
            ->select()
            ->toArray();
        return $list;
    }

}

